import { ArticleService, CommentService } from '../../../services'
const ArticleContent = {
  namespaced: true,
  state: {
    articleContent: {},
    commentList: []
  },
  mutations: {
    setArticleContent(state, payload) {
      state.articleContent = payload
    },
    setCommentList(state, payload) {
      state.commentList = payload
    }
  },
  actions: {
    async GetArticleContent({ commit }, payload) {
      const res = await ArticleService.getArticleContent(payload)
      console.log(res.data)
      commit('setArticleContent', res.data)
    },
    async getMomentCommentList({ commit }, payload) {
      const res = await CommentService.getMomentComment(payload)
      console.log(res.data)
      commit('setCommentList', res.data)
    }
  }
}

export default ArticleContent
